<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="static/css/login.css" />
<style type="text/css">
.err {
	font-size: 12px;
	color: #f00;
}
</style>
</head>
<body>
<script type="text/javascript" src="static/bootstrap/js/jquery-3.4.1.min.js"></script>
<script type="text/javascript">

$(function() {
	$("#check").click(function(){
		$("#checkcode").attr("src","pic?id="+Math.random());
		return false;
	});//刷新验证码
	
	//当用户输完后，自动填充密码
	$("input[name=usrname]").change(function(){
		var val=$(this).val();
	//去cookie里取出该用户名的对应密码，并实现回填
		$.ajax({
			url:'user?action=getCK&name='+val,
		    type:'post',
		    success:function(data){
		    	$("input[name=usrpass]").val(data);
		    }
		});
	});
	
})

</script>
	<div id="login_out">
		<!--第一层-->
		<div id="lay1">
			<img src="img/mistore_logo.png" />
		</div>
		<!--第二层-->
		<div id="lay2"
			style="background-image: url('img/login_bg.jpg'); background-size: cover;">

			<div class="a">
				<div class="b">
					<div class="top">
						<div class="c1">会员登录</div>
						<div class="c2">您还不是我们的会员?</div>
						<div class="c3">注册</div>
					</div>

					<div class="midd">
						<form action="user" method="post">
							<input type="hidden" name="action" value="login" />
							<div class="d">
								<div class="d1">用户名:</div>
								<div class="d2">
									<input type="text" name="usrname" placeholder="请输入你的用户名" />
								</div>
							</div>
							<div class="d">
								<div class="d1">密码:</div>
								<div class="d2">
									<input type="password" name="usrpass" placeholder="请输入你的密码" />
								</div>
							</div>
							<div class="d">
								<div class="d1">验证码:</div>
							</div>
							<div class="d">
								<div class="d2">
									<input type="text" name="checkcode" placeholder="验证码" />
								</div>
								<div class="d5">
									<img src="pic" id="checkcode">
									
								</div>
								<a href="#" id="check" >看不清楚，换一张</a>
							</div>
							<div class="d">
								<input type="checkbox" value="1" name="nologin"/>两周以内自动登录
							</div>
							<div class="d">
								<div class="d3">
									<input type="submit" value="立即登录" />
								</div>
								<span class="err">${error}</span>
							</div> 
						</form>
					</div>
					<div class="di">添加购物车必须先登录</div>
				</div>
			</div>
		</div>
		<!--第三层-->
		<div id="lay3">
			简体&nbsp;&nbsp;|&nbsp;&nbsp;繁体&nbsp;&nbsp;|&nbsp;&nbsp;English&nbsp;&nbsp;|&nbsp;&nbsp;常见问题</div>
		<!--第四层-->
		<div id="lay3">小米公司版权所有-京ICP10046444-警徽-京公网安备11010802020134-京ICP证110507号</div>
	</div>
</body>
</html>
